<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    /**
     * 定义一个函数实现向页面上输出表格
     * 表格的行数、列数作为函数的参数传入
     * 完成函数的调用
    */

   function creatTable(rows,columns){
        var borderWidth = 1;
        var tableWidth = 100*columns;
        var tableHeight = 100*rows;
        var cellSpacing = 0;
        document.write("<table border='"+borderWidth+"' cellspacing='"+cellSpacing+"' width='"+tableWidth+"' height='"+tableHeight+"'>");
        var i=0;
        while(i<rows){
            document.write("<tr>");
            var j=0;
            while(j<columns){
                document.write("<td>");
                document.write("&nbsp;&nbsp");
                document.write("</td>");
                j++;
            }
            document.write("</tr>");
            i++;
        }
        document.write("</table>");
        return true;

   }

   creatTable(2,5);
   result = creatTable(6,6);
   console.log(result);//undefined
</script>
</html>